﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsLive.Writer.Api;
using System.Xml.Serialization;
using System.Collections.Specialized;
using System.Drawing;

namespace WindStyle.WindowsLiveWriter.Plugin.ExifInfo
{
    [Serializable]
    public class Settings
    {
        [XmlElement("DefaultTemplateName")]
        public string DefaultTemplateName { get; set; }

        [XmlElement("Templates")]
        public List<Template> Templates { get; set; }

        public Settings() { }

        public void Reset()
        {
            Template defaultTemplate = new Template()
            {
                Name = "Default"
            };
            this.Templates = new List<Template>();
            Templates.Add(defaultTemplate);
            this.DefaultTemplateName = defaultTemplate.Name;
        }

        public Template GetTemplateByName(string name)
        {
            return this.Templates.Find(new Predicate<Template>(delegate(Template template)
                {
                    return template.Name == name;
                }));
        }
    }
}
